
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Grebok.Common;
using Grebok.Common.Configuration;

namespace JieBooLaw.Persistence.Test.DataManager
{
    public class TSys_UserManager : BaseManager
    {
        #region private field

        private static TSys_UserManager manager;
        #endregion

        #region Properties
        
        public Int32? UserID
        {
            get { return GetConfig<Int32?>("UserID"); }
            set { SetConfig<Int32?>("UserID", value); }
        }
        
        public String Account
        {
            get { return GetConfig<String>("Account"); }
            set { SetConfig<String>("Account", value); }
        }
        
        public String Password
        {
            get { return GetConfig<String>("Password"); }
            set { SetConfig<String>("Password", value); }
        }
        
        public String RealName
        {
            get { return GetConfig<String>("RealName"); }
            set { SetConfig<String>("RealName", value); }
        }
        
        public String Mobile
        {
            get { return GetConfig<String>("Mobile"); }
            set { SetConfig<String>("Mobile", value); }
        }
        
        public String eMail
        {
            get { return GetConfig<String>("eMail"); }
            set { SetConfig<String>("eMail", value); }
        }
        
        public String Description
        {
            get { return GetConfig<String>("Description"); }
            set { SetConfig<String>("Description", value); }
        }
        
        public DateTime? LastLoginTime
        {
            get { return GetConfig<DateTime?>("LastLoginTime"); }
            set { SetConfig<DateTime?>("LastLoginTime", value); }
        }
        
        public Boolean? Active
        {
            get { return GetConfig<Boolean?>("Active"); }
            set { SetConfig<Boolean?>("Active", value); }
        }
        

        #endregion

        #region Constructor

        /// <summary>
        /// TSys_UserManager
        /// </summary>
        private TSys_UserManager()
        {
            IApplicationConfiguration configuration = ApplicationConfigurationFactor.CreateApplicationConfiguration();
            appPropertiese = new ApplicationProperties(configuration[PropertiesConst.TSYS_USER_PROPERTIES_FILE_NAME_KEY],
                configuration[PropertiesConst.TSYS_USER_PROPERTIES_SECTION_NAME_KEY]);

            appPropertieseValues = new Dictionary<string, object>();
        }
        #endregion

        #region TSys_UserManager Instance

        /// <summary>
        /// TSys_UserManager's Instance
        /// </summary>
        public static TSys_UserManager Instance
        {
            get
            {
                if (manager == null)
                {
                    manager = new TSys_UserManager();
                }
                return manager;
            }
        }
        #endregion

    }
}
